using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Warehouse;
using HengTong.Model;


namespace HengTong.ViewModel.SupplyChain.SysWarehouseLocationVms
{
    public partial class SysWarehouseLocationTemplateVm : BaseTemplateVM
    {
        [Display(Name = "库位名称")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.Name);
        [Display(Name = "库位编码")]
        public ExcelPropety CodeExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.Code);
        [Display(Name = "ERP编号")]
        public ExcelPropety ErpIdExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.ErpId);
        [Display(Name = "所属库区")]
        public ExcelPropety AreaExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.AreaId);
        [Display(Name = "所属仓库")]
        public ExcelPropety WarehouseExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.WarehouseId);
        [Display(Name = "描述")]
        public ExcelPropety DescriptionExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.Description);
        [Display(Name = "状态")]
        public ExcelPropety CommonStateExcel = ExcelPropety.CreateProperty<SysWarehouseLocation>(x => x.CommonState);

	    protected override void InitVM()
        {
            AreaExcel.DataType = ColumnDataType.ComboBox;
            AreaExcel.ListItems = DC.Set<SysWarehouseArea>().GetSelectListItems(Wtm, y => y.Name);
            WarehouseExcel.DataType = ColumnDataType.ComboBox;
            WarehouseExcel.ListItems = DC.Set<SysWarehouse>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysWarehouseLocationImportVm : BaseImportVM<SysWarehouseLocationTemplateVm, SysWarehouseLocation>
    {

    }

}
